package com.zn.log
{
    import com.zn.LocalSharedObject;
    import com.zn.utils.DateFormatter;

    /**
     *保存日志到本地
     * @author zn
     *
     */
    public class LocalLogTarget implements ILoggingTarget
    {
        public var localSharedObject:LocalSharedObject;

        public function LocalLogTarget(fileName:String="LocalLogTarget")
        {
			localSharedObject = LocalSharedObject.getLocal(fileName);

			var time:Number=new Date().time;
            var str:String = "" +
                "-----------------------" + DateFormatter.formatterTimeAll(time) + "-----------------------";

			localSharedObject.save(time+"", str);
        }

        public function send(info:String):void
        {
			var time:Number=new Date().time;
			localSharedObject.save(time+"", info);
        }
    }
}
